package edu.rutgers.moko.data.util;

import java.util.Arrays;
import java.util.List;

/**
 * 
 * @author Darja Krushevskaja
 *
 */

public enum PrivacyMode {
	PUBLIC("Public"),
	PROTECTED("Protected"),
	PRIVATE("Private");
	
	private final String name;
	
	private PrivacyMode(String name) {
		this.name = name;
	}

	public String modelName() {
		return name;
	}
	
	public static List<PrivacyMode> valuesAsList(){
		return Arrays.asList(PrivacyMode.values());
	}
	
	public static PrivacyMode getByField(String field){
		PrivacyMode result = PrivacyMode.PUBLIC;
		if("protected".equals(field.toLowerCase())){
			result = PrivacyMode.PROTECTED;
		}
		if("private".equals(field.toLowerCase())){
			result = PrivacyMode.PRIVATE;
		}
		return result;
	}

}
